﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using DHQGHN.DAL.Models.DanhMuc;
using DHQGHN.DAL.Models.Online;

namespace DHQGHN.Services.ONLINE
{
    [ServiceContract]
    public interface IOnlineService
    {
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare,
         UriTemplate = "GetAdministrativeUnit/{code}/{levels}")]
        ADMINISTRATIVE_UNIT GetAdministrativeUnit(string code, string levels);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare
            , UriTemplate = "GenerateLoginCode/{province_code}/{district_code}/{commune_code}/{IsResetAllGenerate}")]
        int GenerateLoginCode(string province_code, string district_code, string commune_code, string IsResetAllGenerate);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare
            , UriTemplate = "GetHouseDetailByLoginCode/{loginCode}/{pin}")]
        HouseDetail GetHouseDetailByLoginCode(string loginCode, string pin);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare
            , UriTemplate = "ResetLoginCodeHouseHold/{HouseHoldId}")]
        string ResetLoginCodeHouseHold(string HouseHoldId);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare
            , UriTemplate = "GetResidentByLoginCode/{loginCode}")]
        IEnumerable<ResidentDetail> GetResidentByLoginCode(string loginCode);

        #region Khai on line
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare
            , UriTemplate = "GetLoginKhaiOnline/{loginCode}")]
        LoginKhaiOnline GetLoginKhaiOnline(string loginCode);

        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare, UriTemplate = "GetAllDmEthnic/{search}")]
        List<DmEthnic> GetAllDmEthnic(string search);
        [OperationContract]
        [WebInvoke(Method = "POST",
            RequestFormat = WebMessageFormat.Json,
             ResponseFormat = WebMessageFormat.Json,
            UriTemplate = "OnlineSaveHousehold")]
        string OnlineSaveHousehold(HouseDetail update);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "OnlineSaveAndGetResident")]
        List<Resident1> OnlineSaveAndGetResident(HouseDetail update);

        [WebInvoke(Method = "GET",
            ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "GetbyRESIDENTbyHOUSEHOLD_ID/{HOUSEHOLD_ID}")]
        List<Resident1> GetbyRESIDENTbyHOUSEHOLD_ID(string HOUSEHOLD_ID);



        [WebInvoke(Method = "GET",
           ResponseFormat = WebMessageFormat.Json,
           RequestFormat = WebMessageFormat.Json,
           UriTemplate = "Getreportall")]
        ReportModel Getreportall();

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "InsertOrUpdateResident1")]
        List<Resident1> InsertOrUpdateResident1(List<Resident1> lst);

        [OperationContract]
        [WebInvoke(Method = "POST",
            BodyStyle = WebMessageBodyStyle.Bare,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "InsertOrUpdateResident2")]
        void InsertOrUpdateResident2(List<Resident1> lst);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "InsertOrUpdateResidentAndGetHouseHold")]
        HouseDetail InsertOrUpdateResidentAndGetHouseHold(List<Resident1> lst);



        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThongTinCaNhan")]
        Khaisinh1Model UpdateThongTinCaNhan(DAL.Models.Online.ThongTinCaNhanModel thongtincanhan);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThongTinCaNhanNew")]
        void UpdateThongTinCaNhanNew(DAL.Models.Online.ThongTinCaNhanModel thongtincanhan);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThongTinCaNhanBack")]
        ThongTinChungModel UpdateThongTinCaNhanBack(DAL.Models.Online.ThongTinCaNhanModel thongtincanhan);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh1")]
        Khaisinh2Model UpdateKhaisinh1(Khaisinh1Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh1New")]
        void UpdateKhaisinh1New(Khaisinh1Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh1Back")]
        ThongTinCaNhanModel UpdateKhaisinh1Back(Khaisinh1Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh2")]
        Khaisinh3Model UpdateKhaisinh2(Khaisinh2Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh2New")]
        void UpdateKhaisinh2New(Khaisinh2Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh2Back")]
        Khaisinh1Model UpdateKhaisinh2Back(Khaisinh2Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh3")]
        Khaisinh4Model UpdateKhaisinh3(Khaisinh3Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh3New")]
        void UpdateKhaisinh3New(Khaisinh3Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh3Back")]
        Khaisinh2Model UpdateKhaisinh3Back(Khaisinh3Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh4")]
        TinhTrangHonNhanModel UpdateKhaisinh4(Khaisinh4Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh4New")]
        void UpdateKhaisinh4New(Khaisinh4Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateKhaisinh4Back")]
        Khaisinh3Model UpdateKhaisinh4Back(Khaisinh4Model khaisinh1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTinhTrangHonNhan")]
        ThuongTru1Model UpdateTinhTrangHonNhan(TinhTrangHonNhanModel tthn);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTinhTrangHonNhanNew")]
        void UpdateTinhTrangHonNhanNew(TinhTrangHonNhanModel tthn);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTinhTrangHonNhanBack")]
        Khaisinh4Model UpdateTinhTrangHonNhanBack(TinhTrangHonNhanModel tthn);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru1")]
        ThuongTru2Model UpdateThuongTru1(ThuongTru1Model tt1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru1New")]
        void UpdateThuongTru1New(ThuongTru1Model tt1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru1Back")]
        TinhTrangHonNhanModel UpdateThuongTru1Back(ThuongTru1Model tt1);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru2")]
        TheCanCuocModel UpdateThuongTru2(ThuongTru2Model tt2);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru2New")]
        void UpdateThuongTru2New(ThuongTru2Model tt2);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateThuongTru2Back")]
        ThuongTru1Model UpdateThuongTru2Back(ThuongTru2Model tt2);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTheCanCuoc")]
        HoChieuModel UpdateTheCanCuoc(TheCanCuocModel tcc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTheCanCuocNew")]
        void UpdateTheCanCuocNew(TheCanCuocModel tcc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateTheCanCuocBack")]
        ThuongTru2Model UpdateTheCanCuocBack(TheCanCuocModel tcc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateHoChieu")]
        LevelModel UpdateHoChieu(HoChieuModel hc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateHoChieuNew")]
        void UpdateHoChieuNew(HoChieuModel hc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateHoChieuBack")]
        TheCanCuocModel UpdateHoChieuBack(HoChieuModel hc);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateMedicine")]
        InsuranceModel UpdateMedicine(MedicineModel medicine);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateMedicineNew")]
        void UpdateMedicineNew(MedicineModel medicine);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateMedicineBack")]
        LaborAndJobModel UpdateMedicineBack(MedicineModel medicine);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateInsurance")]
        ChetMatTichModel UpdateInsurance(InsuranceModel insurance);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateInsuranceNew")]
        void UpdateInsuranceNew(InsuranceModel insurance);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateInsuranceBack")]
        MedicineModel UpdateInsuranceBack(InsuranceModel insurance);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLevel")]
        LaborAndJobModel UpdateLevel(LevelModel level);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLevelNew")]
        void UpdateLevelNew(LevelModel level);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLevelBack")]
        HoChieuModel UpdateLevelBack(LevelModel level);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLaborAndJob")]
        MedicineModel UpdateLaborAndJob(LaborAndJobModel laborJob);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLaborAndJobNew")]
        void UpdateLaborAndJobNew(LaborAndJobModel laborJob);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateLaborAndJobBack")]
        LevelModel UpdateLaborAndJobBack(LaborAndJobModel laborJob);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateChetMattich")]
        void UpdateChetMattich(ChetMatTichModel cm);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "UpdateChetMattichBack")]
        InsuranceModel UpdateChetMattichBack(ChetMatTichModel cm);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetThongtinchung")]
        ThongTinChungModel GetThongtinchung(string residentId);

        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetThongtincanhan")]
        ThongTinCaNhanModel GetThongtincanhan(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetKhaisinh1")]
        Khaisinh1Model GetKhaisinh1(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetKhaisinh2")]
        Khaisinh2Model GetKhaisinh2(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetKhaisinh3")]
        Khaisinh3Model GetKhaisinh3(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetKhaisinh4")]
        Khaisinh4Model GetKhaisinh4(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetTinhtranghonnhan")]
        TinhTrangHonNhanModel GetTinhtranghonnhan(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetThuongtru1")]
        ThuongTru1Model GetThuongtru1(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetThuongtru2")]
        ThuongTru2Model GetThuongtru2(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetThecancuoc")]
        TheCanCuocModel GetThecancuoc(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetHochieu")]
        HoChieuModel GetHochieu(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetLevel")]
        LevelModel GetLevel(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetLabor")]
        LaborAndJobModel GetLabor(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetMedicine")]
        MedicineModel GetMedicine(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetInsurance")]
        InsuranceModel GetInsurance(TTCOM a);
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "GetChetvaMattich")]
        ChetMatTichModel GetChetvaMattich(TTCOM a);
        /// <summary>
        /// </summary>
        /// <param name="HouseHoldId"></param>
        /// <returns></returns>
        [OperationContract]
        [WebGet(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Bare,
            UriTemplate = "SubmitComplete/{HouseHoldId}"
            )]
        string SubmitComplete(string HouseHoldId);
        #endregion

        #region Print Login Code
        [OperationContract]
        [WebInvoke(Method = "POST",
            ResponseFormat = WebMessageFormat.Json,
            RequestFormat = WebMessageFormat.Json,
            UriTemplate = "SearchPrintCodeHouseHold")]
        List<DHQGHN.DAL.Models.TDT.HOUSEHOLD2> SearchPrintCodeHouseHold(SearchPrintCodeHouseHold search);
        #endregion

    }
}
